<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="chtml" uri="http://www.szhelper.com/jsp/html"%>
<%
	String rootPath = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>还款管理</title>
</head>
<body>
<div class="youarehere">还款管理 &gt; <span>标的还款列表</span></div>
<div id="content">
<form action='<chtml:path path="/" />repayment/borrowInfoRepayMentList' method="post" id="borrowInfoRepayMentForm">
<table width="99%" align="center" border="0" cellpadding="1" cellspacing="1" class="data_table">
	<tr>
		<td class="data_tab_th" colspan="6">查询还款计划配置参数</td>
	</tr>
	<tr>
		<td class="data_tab_tdr">还款计划状态</td>
		<td class="data_tab_tdl">
			<select name="status" id="status">
				<option value="UNSETTLE" selected="selected">待还款</option>
				<option value="SETTLING">还款中</option>
				<option value="OVERDURED">已逾期</option>
				<option value="REPAYMENTED">已还清</option>
			</select>
			<script>
				if("${status}" != ""){
					$("#status").attr("value", "${status}");
				}
			</script>
		</td>
		<td class="data_tab_tdr">借款人姓名</td>
		<td class="data_tab_tdl"><input type="text" value="${borrowUserName}" name="borrowUserName" /></td>
		<td class="data_tab_tdr">借款标的名称</td>
		<td class="data_tab_tdl"><input type="text" value="${borrowInfoName}" name="borrowInfoName" /></td>
	</tr>
	<tr>
		<td class="data_tab_tdr">还款截止日(起始)</td>
		<td class="data_tab_tdl"><input type="text" value="${beginDate}" name="beginDate" id="beginDate" readonly /><script type="text/javascript">Calendar.showDate("beginDate");</script></td>
		<td class="data_tab_tdr">还款截止日(结束)</td>
		<td class="data_tab_tdl"><input type="text" value="${endDate}" name="endDate" id="endDate" readonly /><script type="text/javascript">Calendar.showDate("endDate");</script></td>
		<td class="data_tab_tdr"></td>
		<td class="data_tab_tdl"></td>
	</tr>
	<tr>
		<td colspan="6" class="bg_bai">
			<div class="mr_20 t_c">
				<input type="submit" class="pub_bt" value="查询" onclick='document.getElementsByName("PaginationButton_CurrentPage4list")[0].value=1;'/>
				<input type="button" class="pub_bt" value="重置" onclick="this.form.reset();" />
			</div>
	    </td>
	</tr>
</table>
<br />
<!-- 自定义标签示例 --> 
<chtml:list collection="listVo" type="com.hengpeng.itfinoss.controller.repayment.vo.RepaymentPlanVo"  linkTarget="_self"
	includeFields="borrowName,borrowUserNameUrl,totalMoney,repayBaseMoneyStr,repayInterestMoneyStr,periods,lastRepayDate,overdueDate,overduePenaltyStr,status,
	repaymentUrl,platRepaymentUrl,detailUrl"
	fieldWidth="100,70,80,65,65,65,65,65,65,40,45,45,45" 
	detailLink="../borrowInfo/detail/@{borrowInfoId}"
	showLinkField="borrowName"
	showCheckBox="false" title="还款管理" paginationName="page"
	allowSort="false">
</chtml:list>
</form>
<form id="doActionForm" name="doActionForm">
	<input type="hidden" name="borrowinfoId" id="borrowinfoId"/>
	<input type="hidden" name="repaymentPlanId" id="repaymentPlanId"/>
	<input type="hidden" name="curRepayNum" id="curRepayNum"/>
</form>
</div>
<!--说明   -->	
<div class="sm_info">
	<p class="row_one">说明：</p>
	<p class="other"></p>
	<p class="other"></p>
</div>
<script type="text/javascript">
	//平台垫付操作
	//function repaymentByPlat (borrowinfoId, repaymentPlanId) {
	//	if(window.confirm('您确定要平台垫付还款操作吗？')){
	//		$("#borrowinfoId").val(borrowinfoId);
	//		$("#repaymentPlanId").val(repaymentPlanId);
	//		$("#doActionForm").attr("action","<%=rootPath%>/repayment/doBorrowInfoRepayMentByPlat");
	//		$("#doActionForm").submit();
	//	}
	//}
	
	//正常还款操作
	function repayment (borrowinfoId, repaymentPlanId) {
		if(window.confirm('您确定要还款操作吗？')){
			$("#borrowinfoId").val(borrowinfoId);
			$("#repaymentPlanId").val(repaymentPlanId);
			$("#doActionForm").attr("action","<%=rootPath%>/repayment/doBorrowInfoRepayMent");
			$("#doActionForm").submit();
		}
	}
	//查看明细
	function repaymentDetail (borrowinfoId, curRepayNum) {
		$("#borrowinfoId").val(borrowinfoId);
		$("#curRepayNum").val(curRepayNum);
		$("#doActionForm").attr("action","<%=rootPath%>/repayment/repaymentDetail");
		$("#doActionForm").submit();
	}
	//查看借款人详细
	function userInfoDetail (id) {
		$("#doActionForm").attr("action","<%=rootPath%>/user/load/"+id);
		$("#doActionForm").submit();
	}
</script>
</body>
</html>
